package testClient;

import java.awt.BorderLayout;
import java.awt.EventQueue;

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
import java.awt.GridBagLayout;
import java.awt.GridBagConstraints;
import javax.swing.JLabel;
import java.awt.Insets;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JComboBox;
import javax.swing.JButton;
import javax.swing.DefaultComboBoxModel;

public class Login_Fortsetzung extends JFrame {

	private JPanel contentPane;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					Login_Fortsetzung frame = new Login_Fortsetzung();
					frame.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the frame.
	 */
	public Login_Fortsetzung() {
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setBounds(100, 100, 450, 281);
		contentPane = new JPanel();
		contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
		setContentPane(contentPane);
		contentPane.setLayout(null);
		
		JLabel lblLanguage = new JLabel("Language");
		lblLanguage.setBounds(16, 40, 60, 16);
		contentPane.add(lblLanguage);
		
		final JComboBox comboBox = new JComboBox();
		comboBox.setModel(new DefaultComboBoxModel(new String[] {"en", "de", "fr"}));
		comboBox.setBounds(123, 35, 322, 27);
		comboBox.setToolTipText("");
		contentPane.add(comboBox);
		
		JLabel lblMandant = new JLabel("Mandant");
		lblMandant.setBounds(19, 102, 54, 16);
		contentPane.add(lblMandant);
		
		JComboBox comboBox_1 = new JComboBox();
		comboBox_1.setBounds(123, 97, 322, 27);
		contentPane.add(comboBox_1);
		
		JLabel lblAmbiance = new JLabel("Ambiance");
		lblAmbiance.setBounds(15, 164, 62, 16);
		contentPane.add(lblAmbiance);
		
		JComboBox comboBox_2 = new JComboBox();
		comboBox_2.setBounds(123, 159, 322, 27);
		contentPane.add(comboBox_2);
		
		JButton btnNewButton = new JButton("Weiter");
		btnNewButton.setBounds(5, 221, 83, 29);
		contentPane.add(btnNewButton);
		
		btnNewButton.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent evt) {
				
				Client1.getInstance().setLanguage((String)comboBox.getSelectedItem());
				
				Home h = new Home();
				h.setVisible(true);
				dispose();
			}
			
		});
	}
}
